\pard\tx1240\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\b0\i0\ul0\fs28 disk partition file system filesystem export exportfs\
\
Q: Please outline the procedure for repartitioning a SCSI disk (if possible). I would like to create an additional partition so that I may export a file system to a specific machine with specific privileges.\
\
A: Note that under both Release 2.0 and Release 2.1
\b BuildDisk
\b0 now provides an option on some disks for building a one-partition or a two-partition disk. If doing a new
\b BuildDisk
\b0 is an option, that is by far the easiest way to do this.\
\
But, let's assume you can't do this (either because you're still running 1.0 or 1.0a, or because it's just not applicabable in your situation).\
\
If the only thing you want to do is to export a subdirectory, without exporting the parent directory to
\b0 is not exported also, then this is all you need to do: only the machine
\b othermachine
\b0 will be able to mount
\b /subdirectory
\b0 , and access will be read-only.\
\
If you're also exporting a parent directory, with different access, you'll have to build a separate file system.\
\
The file
\b /etc/disktab
\b0 contains the characteristics of the various disk types pre-defined by the system. The comments at the front of
\b disktab
\b0 are fairly descriptive (if you've questions, check the UNIX Manual pages, or contact your appropriate support folks). In Releases 1.0 and 1.0a, any disk you attach to the system must have an appropriate entry in
\b disktab
\b0 ; in Releases 2.0 and 2.1, the disk initialization utilities can craft a
\b disktab
\b0 entry (for a disk with one partition) on the fly. But, if you want a partitioning scheme other than the default, you'll still need to build a
\b disktab
\b0 entry even in 2.0 and 2.1.\
\
Note also that you may have to repeat this when you upgrade to a new release using
\b BuildDisk
\b0 : the
\b BuildDisk
\b0 procedure does not preserve your current disk layout.\
\
What you'll need to do is:\
\
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 1. Copy the
\b disktab
\b0 entry for the way the drive is currently configured. The name of the
\b disktab
\b0 entry used for the drive can be determined by using the
\b /usr/etc/disk
\b0 program: the program displays the name of the
\b disktab
\b0 entry used just after it starts. It'll look something like:\
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\li540 The final line in the stuff above is the prompt from the disk program, and the input
\b quit
\b0 to exit. Note that this was run as root. Note also the
\b disk name:
\b0 line — that has the key info describing which disktab entry you'll copy. (The
\b ?
\b0 or
\b help
\b0 command will list all the commands for disk.)\
part base size bsize fsize cpg density minfree newfs optim automount type\
a 0 676256 8192 1024 32 4096 10% yes time no 4.3BSD\
disk>
\b quit\
\
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\f2\b0\fs28\li540 With the information in the output from
\b disk
\b0 and the information in the UNIX Manual Page for the
\b disk
\b0 command, build a
\b disktab
\b0 entry with the appropriate drive paramters and partition layout.\
\
\fi-280 2. Modify the partition information so it describes the layout you want. Unlike numerous other UNIX and disk systems, it doesn't matter whether you start a partition on a track or cylinder boundary, or not. If you
\i don't
\i0 use such boundaries, you might waste a little space (check for messages from
\b mkfs
\b0 ). It is important that the only things you change are the partition-specific information, and the name of the
\b disktab
\b0 entry.\
\
3. Save the new
\b disktab
\b0 entry as part of the
\b disktab
\b0 file.\
\
4. Backup anything on the disk that isn't stored elsewhere.\
\
5. Boot from another device (we'll use an optical disk in this example). Become root. Save the original
\b disktab
\b0 file that's on the OD (rename it to, for example,
\b /etc/disktab.ORIG
\b0 ). Copy the
\b disktab
\b0 file from the SCSI, after mounting its partition a (this is the modified
\b disktab
\b0 you created in Steps 2 and 3). Unmount the SCSI disk.\
\
6. Run the
\b disk
\b0 command, using it the -t option. E.g., if your
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 7. Write a new label, which will incorporate the changes you've made to the
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 8. If you're changing the entire disk layout — if dividing a one-partition disk into two partitions, or if you're reallocating some of the space from Partition A — you'll want to use
\b disk
\b0 's
\b init
\b0 command. This will prepare the disk for placing your data back on it. When you're done, exit
\b disk
\b0 .\
\
\fi0 Alternatively, you might simply be splitting Partition B into two pieces. In this case, since you're not changing Partition A, you don't have to reinitialize the entire disk. You can simply build the new partitions, using
\b newfs
\b0 . Exit
\b disk
\b0 , and run
\b newfs
\b0 , as in the following example (which is for a Partition C):\
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 9. Mount the new partitions and restore the backed-up file system from Step 4, above (using
\b /usr/etc/restore
\b0 ; see the UNIX Manual page).\
\
10. On the SCSI (Partition A), modify the file in
\b /etc/exports
\b0 , adding the file system you created. Likewise, modify
\b /etc/fstab
\b0 (there's no need to modify NetInfo's
\b /mounts
\b0 directory: NetInfo isn't running when the local file systems are mounted).\
\
\pard\tx620\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 11. Reboot the system. Check to be sure everything is OK. Note
\pard\tx520\tx2480\tx3740\tx4980\tx6240\tx7480\tx8720\tx9980\tx11220\tx12480\fi-280\li540 that the
\b exportfs
\b0 command will print the current state of what's